package com
{
	import flash.display.Sprite;
	
	public class musicInstrument
	{
		private static var instanceGet:musicInstrument;
		
		public static function getInstance():musicInstrument
		{
			if(instanceGet == null)
			{
				instanceGet = new musicInstrument();
			}
			return instanceGet;
		}
		
		public function musicIMenuItem(str:String):Sprite
		{
			var sprite:Sprite = new Sprite();
			switch(str)
			{
				case "Guitar":
				{
					var custom1:Guitar0 = new Guitar0();
					sprite.addChild(custom1);
					break;
				}
				case "Drum":
				{
					var custom2:Drum0 = new Drum0();
					sprite.addChild(custom2);
					break;
				}
				case "check":
				{
					var custom3:KeyBoard0 = new KeyBoard0();
					sprite.addChild(custom3);
					break;
				}
				
				default:
				{
					break;
				}
			}
			return sprite;
		}
		
		public function decorationItemFinder(str:String):Sprite
		{
			var chkStr:String = str.slice(0,str.length-1);
			var sprite:Sprite = new Sprite();
			switch(chkStr)
			{
				case "Guitar":
				{
					sprite.addChild(guitarFinder(str));
					break;
				}
				case "Drum":
				{
					sprite.addChild(DrumFinder(str));
					break;
				}
				case "check":
				{
					sprite.addChild(checkFinder(str));
					break;
				}
				
				default:
				{
					break;
				}
			}
			return sprite;
		}
		public function guitarFinder(str:String):Sprite
		{
			switch(str)
			{
				case "Guitar1":
				{
					var Guitar1:Guitar0= new Guitar0();
					Guitar1.height = 84;
					Guitar1.width = 76;
					return Guitar1;
					break;
				}
				case "Guitar2":
				{
					var Guitar2:GuitarLead2 = new GuitarLead2();
					Guitar2.height = 84;
					Guitar2.width = 76;
					return Guitar2;
					break;
				}	
				case "Guitar3":
				{
					var Guitar3:GuitarLead1 = new GuitarLead1();
					Guitar3.height = 84;
					Guitar3.width = 76;
					return Guitar3;
					break;
				}
				case "Guitar4":
				{
					var Guitar4:GuitarLead0 = new GuitarLead0();
					Guitar4.height = 84;
					Guitar4.width = 76;
					return Guitar4;
					break;
				}
				case "Guitar5":
				{
					var Guitar5:GuitarLead1 = new GuitarLead1();
					Guitar5.height = 84;
					Guitar5.width = 76;
					return Guitar5;
					break;
				}
				default:
				{
					break;
				}
			}
			return null;
		}
		private function DrumFinder(str:String):Sprite
		{
			switch(str)
			{
				case "Drum1":
				{
					var drum1:Drum0= new Drum0();
					return drum1;
					break;
				}
				case "Drum2":
				{
					var drum2:Drum1 = new Drum1();
					return drum2;
					break;
				}	
				case "Drum3":
				{
					var drum3:Drum2 = new Drum2();
					return drum3;
					break;
				}
				case "Drum4":
				{
					var drum4:Drum3 = new Drum3();
					return drum4;
					break;
				}
				case "Drum5":
				{
					var drum5:Drum4 = new Drum4();
					return drum5;
					break;
				}
				default:
				{
					break;
				}
			}
			return null;
		}
		private function checkFinder(str:String):Sprite
		{
			switch(str)
			{
				case "check1":
				{
					var check1:KeyBoard0= new KeyBoard0();
					return check1;
					break;
				}
				case "check2":
				{
					var check2:KeyBoard1= new KeyBoard1(); 
					return check2;
					break;
				}	
				case "check3":
				{
					var check3:KeyBoard2 = new KeyBoard2();
					return check3;
					break;
				}
				case "check4":
				{
					var check4:KeyBoardD0 = new KeyBoardD0();
					return check4;
					break;
				}
				case "check5":
				{
					var check5:KeyBoardD1 = new KeyBoardD1();
					return check5;
					break;
				}	
				default:
				{
					break;
				}
			}
			return null;
		}
		
		public function musicItems()
		{
			
			
		}
	}
}